package tool;

import java.util.ArrayList;

public class CoordinateArray extends ArrayList<Coordinate>{
		public int indexOf(Coordinate c){
			int i=0;
			for(Coordinate x:this){
				if(x.equals(c)){
					return i;
				}
				i = i+1;
			}
			return -1;
		}
		
		public static void main(String args[]){
			Coordinate c = new Coordinate(1,1,1);
			Coordinate c2 = new Coordinate(1,1,2);
			CoordinateArray cs = new CoordinateArray();
			cs.add(c);
			cs.add(c2);
			Coordinate c3 = new Coordinate(1,1,2);
			System.out.println(cs.indexOf(c3));
		}
}
